package com.taxshare.purchaser.controller;

import com.taxshare.mybatis.pager.PageRequest;
import com.taxshare.purchaser.entity.QuotaTicketEntity;
import com.taxshare.purchaser.service.QuotaTicketCollectService;
import com.taxshare.purchaser.view.dto.QuotaTicketDTO;
import com.taxshare.response.beans.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author YANG
 * @date 2021/4/9
 */
@RestController
@RequestMapping("/quotaTicketCollect")
@Api(tags = "定额发票采集")
public class QuotaTicketCollectController {

    @Autowired
    QuotaTicketCollectService quotaTicketCollectService;

    @PostMapping("/query")
    @ApiOperation(value = "定额发票查询", notes = "发票采集")
    public Response<QuotaTicketEntity> queryQuotaTicket(@RequestBody PageRequest<QuotaTicketDTO> query) {
        return quotaTicketCollectService.queryQuotaTicket(query);
    }

    @PostMapping("/delete")
    @ApiOperation(value = "定额发票删除", notes = "发票采集")
    public Response quotaTicketDelete(@RequestBody QuotaTicketDTO quotaTicketDTO) {
        return quotaTicketCollectService.quotaTicketDelete(quotaTicketDTO);
    }

    @PostMapping("/personLiable")
    @ApiOperation(value = "责任人、记账科目、授权报销设置设置", notes = "未报销")
    public Response personLiable(@RequestBody QuotaTicketDTO quotaTicketDTO) {
        return quotaTicketCollectService.personLiable(quotaTicketDTO);
    }

    @PostMapping("/submit")
    @ApiOperation(value = "提交报销", notes = "未报销")
    public Response submitReimbursement(@RequestBody QuotaTicketDTO quotaTicketDTO) {
        return quotaTicketCollectService.submitReimbursement(quotaTicketDTO);
    }

    @PostMapping("/applicationRejected")
    @ApiOperation(value = "申请驳回", notes = "已报销")
    public Response applicationRejected(@RequestBody QuotaTicketDTO quotaTicketDTO) {
        return quotaTicketCollectService.applicationRejected(quotaTicketDTO);
    }
}
